<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>

<!--  2010-07-21 开关控制 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<title>开关控制</title>
	<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
    <script src="<%=path%>/js/syAjax.js" type="text/javascript"></script>
    <script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
    <script type="text/javascript">
    //页面添加选项时需要在此数组添加ID
    var idArray=new Array("Ber_Auditing","StudentLookRanking","shortInfo","TeacherCourseOrg","StudentInfoUpdate");
    window.onload=function()
    {
    resizeIframe();
      for(var i=0;i<idArray.length;i++)
      {
        syAjax.request("post","<%=path%>/findByBasicConfigIdBasicConfigAction.action","basicConfig.basicConfigId="+idArray[i]+"&i="+(i+1),{success:loadResult,fail:onFail,type:'plain'});
      }
    }
    
    function loadResult(response)
    {
      try{
	      var data=response.split("#");
	      if(data[0]=="open")
	      {
	        document.getElementsByName("value"+data[1])[0].checked=true;
	      }else if(data[0]=="" || data[0]=="close")
	      {
	        document.getElementsByName("value"+data[1])[1].checked=true;
	      }
      }catch(e){
	      for(var i=1;i<=idArray.length;i++)
	      {
	        document.getElementsByName("value"+i)[1].checked=false;
	      }
      }
    }
    //设置开关
    function setOpenOrClose(num,result)
    {
      var id=document.getElementById("basicConfigId"+num).value;
      var name=document.getElementById("name"+num).value;
      syAjax.request("post","<%=path%>/updateBasicConfigAction.action","basicConfig.basicConfigId="+id+"&basicConfig.name="+name+"&basicConfig.value="+result,{success:initSaveResult,fail:onFail,type:'plain'});
    }
    
    function initSaveResult(response)
    {
      if(response!=null && response!="")
      {
        alert(response);
      }
    }
    
    function tdClick(url)
     {
       window.location.href=url;
     }
    </script>
  </head>
  
  <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" class="f_5">基本设置</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" background="<%=path %>/images/sywesp_24.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
       
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action');" style="cursor:pointer;">年级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
             <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action?setGraduation=true');" style="cursor:pointer;">毕业年级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path%>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}');"" style="cursor:pointer;">班级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="90" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action');" style="cursor:pointer;">年度学期设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/findCourseByParentCourseIdCourseAction.action');" style="cursor:pointer;">学科设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/findAllOrganizationByTypeorganizationAction.action?organization.orgType=1');" style="cursor:pointer;">教研组设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('findAllCodeMaintenanceTypeCodeMaintenanceAction.action');" style="cursor:pointer;">选项配置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_25.gif" class="f_9">开关控制</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/initMethodGraduationAndUpgradeAction.action');">毕业升级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/toClassSectionTimesListClassSectionTimesAction.action');">课时管理</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td align="left">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="tb_8 border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" align="left" bgcolor="#FFFFFF" class="f_8">注：可以通过选择开关来对代码字段进行控制,如要使变更生效，请刷新页面。</td>
              </tr>
            <tr>
              <td height="30" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="2" height="24" align="left" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_20.gif" width="2" height="24" /></td>
                                <td align="left" background="<%=path %>/images/sywesp_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="1%">&nbsp;</td>
                                      <td width="30%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />代码标识</td>
                                      <td width="51%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />名称</td>
                                      <td width="18%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />选项</td>
                                      </tr>
                                </table></td>
                                <td width="4" align="right" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_22.gif" width="4" height="24" /></td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td height="25" align="left" valign="top" class="tb_7">
                                
     
                                  <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                      <td width="30%" height="25" align="left" valign="bottom">Ber_Auditing</td>
                                      <td width="51%" align="left" valign="bottom">资源审核开关</td>
                                      <td width="18%" valign="bottom">
                                        <input type="hidden" id="basicConfigId1" value="Ber_Auditing" />
                                        <input type="hidden" id="name1" value="资源审核开关" />
	                                    <input type="radio" name="value1" value="open" onclick="setOpenOrClose('1',this.value);" />开
	                                    <input type="radio" name="value1" value="close" onclick="setOpenOrClose('1',this.value);" />关
                                      </td>
                                    </tr>
                                  </table>
                                    <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                      <td width="30%" height="25" align="left" valign="bottom">shortInfo</td>
                                      <td width="51%" align="left" valign="bottom">短信开关</td>
                                      <td width="18%" valign="bottom">
                                        <input type="hidden" id="basicConfigId3" value="shortInfo" />
                                        <input type="hidden" id="name3" value="短信开关" />
	                                    <input type="radio" name="value3" value="open" onclick="setOpenOrClose('3',this.value);" />开
	                                    <input type="radio" name="value3" value="close" onclick="setOpenOrClose('3',this.value);" />关
                                      </td>
                                    </tr>
                                  </table><table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                      <td width="30%" height="25" align="left" valign="bottom">student_look_ranking</td>
                                      <td width="51%" align="left" valign="bottom">是否让学生看到排名</td>
                                      <td width="18%" valign="bottom">
                                        <input type="hidden" id="basicConfigId2" value="StudentLookRanking" />
                                        <input type="hidden" id="name2" value="是否让学生看到排名" />
	                                    <input type="radio" name="value2" value="open" onclick="setOpenOrClose('2',this.value);" />是
	                                    <input type="radio" name="value2" value="close" onclick="setOpenOrClose('2',this.value);" />否
                                      </td>
                                    </tr>
                                  </table>
                                  <!-- 新添加  2011-10-17 配合神龙小学，教师岗位安排中，任课安排时，是否关联教师学科分组的开关 -->
                                  <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                      <td width="30%" height="25" align="left" valign="bottom">teacher_course_org</td>
                                      <td width="51%" align="left" valign="bottom">岗位安排关联学科分组功能开关</td>
                                      <td width="18%" valign="bottom">
                                        <input type="hidden" id="basicConfigId4" value="TeacherCourseOrg" />
                                        <input type="hidden" id="name4" value="岗位安排关联学科分组开关" />
	                                    <input type="radio" name="value4" value="open" onclick="setOpenOrClose('4',this.value);" />开
	                                    <input type="radio" name="value4" value="close" onclick="setOpenOrClose('4',this.value);" />关
                                      </td>
                                    </tr>
                                  </table>
                                  <!-- 添加结束 -->
                                  
                                   <!-- 新添加  2012-6-27 需求，将学生个人信息按照时间对学生开放编辑权限 -->
                                  <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                      <td width="30%" height="25" align="left" valign="bottom">student_info_update</td>
                                      <td width="51%" align="left" valign="bottom">学生个人信息编辑权限开关</td>
                                      <td width="18%" valign="bottom">
                                        <input type="hidden" id="basicConfigId5" value="StudentInfoUpdate" />
                                        <input type="hidden" id="name5" value="学生个人信息编辑权限开关" />
	                                    <input type="radio" name="value5" value="open" onclick="setOpenOrClose('5',this.value);" />开
	                                    <input type="radio" name="value5" value="close" onclick="setOpenOrClose('5',this.value);" />关
                                      </td>
                                    </tr>
                                  </table>
                                  <!-- 添加结束 -->
                                  </td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                    </table></td>
                  </tr>
                  
              </table></td>
            </tr>
          </table>
          </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
  </body>
</html>
